package cn.edu.imau.zy.system.service.impl;

import java.util.List;

import cn.edu.imau.zy.common.core.entity.system.SysGradeYear;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.edu.imau.zy.system.mapper.SysGradeYearMapper;
import cn.edu.imau.zy.system.service.ISysGradeYearService;
import cn.edu.imau.zy.common.core.text.Convert;

/**
 * 年级Service业务层处理
 * 
 * @author wyz
 * @date 2020-06-24
 */
@Service
public class SysGradeYearServiceImpl extends ServiceImpl<SysGradeYearMapper,SysGradeYear> implements ISysGradeYearService
{
    @Autowired
    private SysGradeYearMapper sysGradeYearMapper;

    /**
     * 查询年级
     * 
     * @param year 年级ID
     * @return 年级
     */
    @Override
    public SysGradeYear selectSysGradeYearById(Long year)
    {
        return sysGradeYearMapper.selectSysGradeYearById(year);
    }

    /**
     * 查询年级列表
     * 
     * @param sysGradeYear 年级
     * @return 年级
     */
    @Override
    public List<SysGradeYear> selectSysGradeYearList(SysGradeYear sysGradeYear)
    {
        return sysGradeYearMapper.selectSysGradeYearList(sysGradeYear);
    }

    /**
     * 新增年级
     * 
     * @param sysGradeYear 年级
     * @return 结果
     */
    @Override
    public int insertSysGradeYear(SysGradeYear sysGradeYear)
    {
        return sysGradeYearMapper.insertSysGradeYear(sysGradeYear);
    }

    /**
     * 修改年级
     * 
     * @param sysGradeYear 年级
     * @return 结果
     */
    @Override
    public int updateSysGradeYear(SysGradeYear sysGradeYear)
    {
        return sysGradeYearMapper.updateSysGradeYear(sysGradeYear);
    }

    /**
     * 删除年级对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysGradeYearByIds(String ids)
    {
        return sysGradeYearMapper.deleteSysGradeYearByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除年级信息
     * 
     * @param year 年级ID
     * @return 结果
     */
    @Override
    public int deleteSysGradeYearById(Long year)
    {
        return sysGradeYearMapper.deleteSysGradeYearById(year);
    }
}
